//
//  QImageView.m
//  SSOTest
//
//  Created by lianglibao on 2018/8/6.
//  Copyright © 2018年 梁立保. All rights reserved.
//

#import "QImageView.h"
#import "UIView+VLAdditions.h"

@interface QImageView ()
@property (nonatomic, strong) UILabel *answerLabel;

@end

@implementation QImageView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupSubViews];
    }
    return self;
}

- (instancetype)init {
    if (self = [super init]) {
      
    }
    return self;
}

- (void)setupSubViews {
    [self addSubview:({
        UILabel *answerLabel = [UILabel new];
        answerLabel.font = [UIFont systemFontOfSize:16];
        answerLabel.textColor = [UIColor blueColor];
        answerLabel.textAlignment = NSTextAlignmentCenter;
        answerLabel.size = CGSizeMake(self.width, 30);
        answerLabel.center = CGPointMake(self.width/2.0, self.height/2.0);
        _answerLabel = answerLabel;
        answerLabel;
    })];
}

- (void)setFlag:(BOOL)flag {
    _flag = flag;
    if (flag) {
        _answerLabel.text = @"✅";
    } else {
        _answerLabel.text = @"❌";
    }
}

@end
